$file = $this->getFile();
$line = $this->getLine();
$message = $this->getMessage();
- return $wgRequest->getRequestURL() . " Exception from line $line of $file: $message";
+ if ( isset( $wgRequest ) ) {
+ $url = $wgRequest->getRequestURL();
+ if ( !$url ) {
+ $url = '[no URL]';
+ }
+ } else {
+ $url = '[no req]';
+ }
+
+ return "$url Exception from line $line of $file: $message";
}
/** Output the exception report using HTML */
try {
$this->executeAction();
} catch (Exception $e) {
+ // Log it
+ if ( $e instanceof MWException ) {
+ wfDebugLog( 'exception', $e->getLogMessage() );
+ }
+
//
// Handle any kind of exception by outputing properly formatted error message.
// If this fails, an unhandled exception should be thrown so that global error